package cn.bandeqing.frame.controller;

import cn.bandeqing.base.aliyun.StsToken;
import cn.bandeqing.base.resp.Resp;
import com.aliyun.sts20150401.models.AssumeRoleResponseBody;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "阿里云STS")
@RestController
@RequestMapping("/aliyun/sts")
public class AliyunStsController {

    @Operation(summary = "获取临时凭证")
    @PostMapping("/get")
    public Resp<AssumeRoleResponseBody.AssumeRoleResponseBodyCredentials> get() {
        return Resp.success(StsToken.get());
    }

}
